﻿using NoteHelper.Utils;
using System;

namespace NoteHelper.Sys
{
    public partial class Sysm001 : WeifenLuo.WinFormsUI.Docking.DockContent
    {
        private BaseFormBuilder _formBuilder;
        public Sysm001()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var errors = _formBuilder.CheckErrors();
            if (errors.Count > 0)
            {
                AlterMsg.Info(string.Join("!", errors));
                return;
            }

            _formBuilder.Generate();
            AlterMsg.Info("已经生成！");
        }

        private void Sysm001_Load(object sender, EventArgs e)
        {
            _formBuilder = new BaseFormBuilder();
            _formBuilder.FormNameSpace = "NoteHelper.Sys";
            _formBuilder.FormClassName = "Sysm002";
            _formBuilder.FromText = "模板";
            _formBuilder.FormWidth = 700;
            _formBuilder.FormType = InheritType.Docking;
            _formBuilder.OutputPath = System.IO.Path.GetFullPath("../../Sys");
            _formBuilder.DataFields = new[] { "$_rowIndex", "ObjectID" };
            _formBuilder.DisplayTitles = new[] { "下标", "编号" };

            propertyGrid1.SelectedObject = _formBuilder;
        }
    }
}
